package ch.bfh.java.directorysynchronizer.presentation.Frame;


import java.awt.Container;
import java.awt.FlowLayout;

import javax.swing.JFrame;

import ch.bfh.java.directorysynchronizer.presentation.items.Workbench;

public class MainFrame extends JFrame{
	
	/**
     * 
     */
    private static final long serialVersionUID = 1L;
    
	private Workbench workbench;
	private Container container;
	
	
	public MainFrame(Workbench wb){
		this.workbench = wb;
		this.workbench.setMainFrame(this);
		
		//Setzt Groesse und position des Frames; Were von Workbench
		this.setSize(workbench.getMainframewidth(), workbench.getMainframeheight());	
		this.setLocation(workbench.getMainframeposition());
		this.setName("Directory Synchronizer");
		this.setTitle("Directory Synchronizer");
		this.setDefaultCloseOperation(EXIT_ON_CLOSE);
		
		//Layout 	
		this.container = this.getContentPane();
		this.container.setLayout(new FlowLayout());
		
		//Titel
		this.container.add(new TitelPanel(workbench));
		
		//Directories waehlen
		this.container.add(new ChooseADirectoryPanel(workbench));
		
		//Sync starten / stopen
		this.container.add(new StartStopPanel(workbench));
		
		//Logfileviewer
		this.container.add(new LogfilePanel(workbench));
		
		//fussnoten
		this.container.add(new SubPanel(workbench));
		
		this.setVisible(true);
		
	}
	
	

}
